<%@ page import="top.wuyang.study.javaexam.TbGoods" %>
<%@ page import="top.wuyang.study.javaexam.TbGoodsDAO" %><%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/6/23
  Time: 18:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加</title>
</head>
<body>


<%
    request.setCharacterEncoding("UTF-8");
    TbGoods tbGoods = new TbGoods();
    tbGoods.setTypeinfo(request.getParameter("typeinfo"));
    tbGoods.setGname(request.getParameter("gname"));
    tbGoods.setPrice(Integer.parseInt(request.getParameter("price")));
    tbGoods.setAmount(Integer.parseInt(request.getParameter("amount")));
    TbGoodsDAO.insert(tbGoods);

%>


<script>
    alert("添加成功")
    location.href = "list.jsp";
</script>

</body>
</html>
